package cn.ilikes.tools.nosql.jpa.clients.indexs.index.lucenes;

import java.io.IOException;

import org.apache.lucene.search.DocIdSetIterator;

public class PageDocIdSetIterator extends DocIdSetIterator {
	int doc = 0;
	int start = 0;
	int max = 50;

	@Override
	public int advance(int target) throws IOException {
		//		System.out.println("============== advance   " + target);
		int doc = 0;
		while (doc < target) {
			doc = nextDoc();

		}

		return doc;
	}

	@Override
	public int docID() {
		//System.out.println("============== docID   ");
		return doc;
	}

	@Override
	public int nextDoc() throws IOException {
		//System.out.println("============== nextDoc   " + this.toString());
		if (doc < max)
			return -1;
		doc = doc + 1;
		return doc + 1;
	}

}
